package com.andy.app_core.net.rx;


import java.io.File;
import java.util.HashMap;

import okhttp3.RequestBody;

/**
 * @version V1.0
 * @描述:
 * @Company:
 * @auth: Created by AN .
 * @time: 2020/3/26 15:59
 * @des
 */
public class RxRestClientBuilder {
    private HashMap<String,Object> mParams;
    private String mUrl;
    private RequestBody mBody;

    //上传下载
    private File mFile;

    public RxRestClientBuilder() {
    }
    public final RxRestClientBuilder url(String url){
        this.mUrl=url;
        return this;
    }
    public final RxRestClientBuilder parms(HashMap<String,Object> parms){
        this.mParams=parms;
        return this;
    }
    public final RxRestClientBuilder body(RequestBody body){
        this.mBody=body;
        return this;
    }

    //上传
    public final RxRestClientBuilder file(File file){
        this.mFile=file;
        return this;
    }
    public final RxRestClientBuilder file(String file){
        this.mFile=new File(file);
        return this;
    }

    public final RxRestClient build(){
        return new RxRestClient(mParams,mUrl,mBody,mFile);
    }
}
